import { createSlice } from '@reduxjs/toolkit'
import type { User } from '@/types/user'
import { PayloadAction } from '@reduxjs/toolkit'

const userSlice = createSlice({
  name: 'user',
  initialState: {} as User,
  reducers: {
    setUserInfo (_, action: PayloadAction<User>) {
      return action.payload
    }
  }
})
export const { setUserInfo } = userSlice.actions
export default userSlice.reducer
